Skip to content

Observation scoring PR - #321

Merged
mattlevine22 merged 16 commits into
mainfrom
ml-filter-scoring-2-refactor
Aug 17, 2026
Merged

Observation scoring PR#321
mattlevine22 merged 16 commits into
mainfrom
ml-filter-scoring-2-refactor

Conversation

@mattlevine22

Copy link
Copy Markdown
Collaborator

Supersedes #296

@mattlevine22
mattlevine22 marked this pull request as ready for review August 16, 2026 18:29
@mattlevine22
mattlevine22 requested a review from DanWaxman August 16, 2026 18:29

@DanWaxman DanWaxman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small comments. I also opened #323 for some other changes.

In general, I find it a bit sad we can't use this with LatentPathBuilder. I guess this is fine as an intermediate draft so we get the feature out, but I'd like to have a more general Simulator-based inference interface here. This should enable use with LPB and scoring at lead time. But again happy to boot that to some other time in the near future.

Comment on lines +191 to +226
try:
if isinstance(rule, gaussian_rules):
if predictions.mean is None:
raise NotImplementedError(
_missing_prediction_error(rule.site_name, "mean", "")
)
if predictions.obs_cov is None:
raise NotImplementedError(
_missing_prediction_error(rule.site_name, "obs_cov", "")
)
score_arrays[rule.site_name] = rule.compute(
obs_values=obs_arr,
pred_mean=predictions.mean,
pred_cov=predictions.obs_cov,
)
elif isinstance(rule, EnergyScore):
score_ensemble = _select_scoring_ensemble(
predictions,
scoring_config=scoring_config,
rule_name=rule.site_name,
)
score_arrays[rule.site_name] = rule.compute(
obs_values=obs_arr,
pred_mean=predictions.mean,
pred_cov=predictions.obs_cov,
pred_ensemble=score_ensemble,
sample_seed=scoring_config.sample_seed,
)
else:
raise NotImplementedError(
f"Unsupported observation scoring rule type: {type(rule).__name__}."
)
except NotImplementedError:
if scoring_config.unsupported == "skip":
continue
raise

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully get this API choice, i.e., to allow for unsupported scores to be requested.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a comment about anything in particular, but I'm surprised this is such a big file!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduced from 265 -> 215

DanWaxman and others added 3 commits August 17, 2026 14:37
* Add deprecration notice for diagnostics/plotting_utils

* Doc changes
… passing information directly when available
@mattlevine22
mattlevine22 requested a review from DanWaxman August 17, 2026 19:47

@DanWaxman DanWaxman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mattlevine22
mattlevine22 merged commit 2b35e9a into main Aug 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants